import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';
import Job from './job.entity';

/**
 * 职位
 */
@Entity('position')
export default class Position extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @OneToMany(() => Job, (job) => job.company)
  jobs: Job[];

  @Column({ nullable: true, comment: '父级ID' })
  pid: number;

  @Column({ comment: '名称' })
  name: string;

  @Column({ name: 'enable_status', default: 1, comment: '启用状态' })
  enableStatus: number;

  @Column({ comment: '热门职位' })
  hot: number;
}
